#pragma once

#include <iostream>
#include <string>

#include "../../comm/util.hpp"
#include "../../comm/log.hpp"

namespace ns_file
{
    using namespace ns_util;
    using namespace ns_log;

    class myFile
    {
    public:
        std::string _path;
        std::string _data;
        std::string _content_type;

        myFile(std::string path, int mode = 0)
            : _path(path)
        {
            if (!fileUtil::readFile(_path, &_data))
            {
                LOG(ERROR) << "读取 " << _path << " 失败"
                           << "\n";
                return;
            }
            stringUtil::getContentType(_path, &_content_type);
        }
    };
}